package com.java.yz.day14.Yield;

public class MyYieldThread extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println(getName()+"-"+i);
            //yield()是静态的，直接类名.
            Thread.yield();
        }
    }
}
